package org.jawa.exam.model;

import org.jawa.core.cache.CacheSizes;
import org.jawa.core.cache.Cacheable;
import org.jawa.core.cache.CannotCalculateSizeException;

/**
 * 
 * 类文件: QuestionOption
 * <p>
 * <p>
 * 类描述：试题选项信息表
 * <p>
 * 作 者： migrant423
 * <p>
 * 日 期： 2012-7-13
 * <p>
 * 时 间： 下午2:06:05
 * <p>
 */
public class QuestionOption implements Cacheable {

    private static final long serialVersionUID = 4586745692160689194L;
    /**
     * 选项编号
     */
    private Long optionId;
    /**
     * 试题编号
     */
    private Long questionId;
    /**
     * 选项值
     */
    private String opationCode;
    /**
     * 选项内容
     */
    private String optionContent;

    public QuestionOption() {

    }

    public Long getOptionId() {
	return optionId;
    }

    public void setOptionId(Long optionId) {
	this.optionId = optionId;
    }

    public Long getQuestionId() {
	return questionId;
    }

    public void setQuestionId(Long questionId) {
	this.questionId = questionId;
    }

    public String getOpationCode() {
        return opationCode;
    }

    public void setOpationCode(String opationCode) {
        this.opationCode = opationCode;
    }
    

    public String getOptionContent() {
        return optionContent;
    }

    public void setOptionContent(String optionContent) {
        this.optionContent = optionContent;
    }

    public int getCachedSize() throws CannotCalculateSizeException {
	int size = 0;
	size += CacheSizes.sizeOfObject(); // overhead of object
	size += CacheSizes.sizeOfLong(); // optionId
	size += CacheSizes.sizeOfLong(); // questionId
	size += CacheSizes.sizeOfString(opationCode); // opationCode
	size += CacheSizes.sizeOfString(optionContent); // opationContent
	return size;
    }

}
